﻿<Application x:Class="AmazonGlacierGUI.UI.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"             
             xmlns:Infrastructure="clr-namespace:AmazonGlacierGUI.UI.Infrastructure"
             xmlns:Converters="clr-namespace:AmazonGlacierGUI.UI.Infrastructure.MVVMFramework.Converters">
    <Application.Resources>
        <Converters:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter"></Converters:InverseBooleanToVisibilityConverter>
        <Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"></Converters:BooleanToVisibilityConverter>
        <Converters:BytesToTextConverter x:Key="BytesToTextConverter"></Converters:BytesToTextConverter>
        <Infrastructure:NullCommand x:Key="NullCommand"/>        
        <Style x:Key="ToolBarButton" TargetType="Button">
            <Setter Property="Width" Value="64"></Setter>
            <Setter Property="Height" Value="80"></Setter>

        </Style>

        <Style TargetType="{x:Type TextBox}">
            <Style.Triggers>
                <Trigger Property="Validation.HasError" Value="true">
                    <Setter Property="Background" Value="Pink"/>
                    <Setter Property="Foreground" Value="Black"/>
                </Trigger>
            </Style.Triggers>
            <Setter Property="Validation.ErrorTemplate">
                <Setter.Value>
                    <ControlTemplate>
                        <DockPanel LastChildFill="True" 
                   ToolTip="{Binding ElementName=controlWithError,Path=AdornedElement.(Validation.Errors)[0].ErrorContent}">
                            <TextBlock DockPanel.Dock="Right" 
                       Foreground="Red"
                       FontSize="14pt" 
                       Margin="-15,0,0,0" FontWeight="Bold">*
                            </TextBlock>
                            <Border BorderBrush="Red" BorderThickness="1">
                                <AdornedElementPlaceholder Name="controlWithError" />
                            </Border>
                        </DockPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </Application.Resources>
</Application>
